<?php
	// Set up mysqli connection
	require_once('../../php-transact/db_connect.php');
	
	
	
	// requested from the registration form
	if(isset($_POST['name']))
	{		
		$query=$mysqli->prepare("SELECT * FROM USERS WHERE username = ?;");
		$query->bind_param("s", $_POST['name']);
		$query->execute();
		$query->store_result();
		
		echo $query->num_rows();
		
		// Close mysqli connection
		$query->close();
	} else 	{
		// Redirect to index.php
		header("Location: ../index.php");
	}
?>